<div class="content_block">
	<div class="content_header">Добавление трека</div>
	<div class="content_fill">
	<div style="padding:0px 10px 0px 10px">
		<form action = '<?php echo $addr ?>/edit.php?type=track&poid=<?php echo $i ?>' method='post'>
			<div class="divclear ptop">
				<div class="flleft alright w200p"><label for="cat">Категория: </label></div> 
				<div class="flleft alleft w525p">
					<select id="cat" name="cat" style="width:140px;">
						<?php for ($j = 1; $j <= endKey($category); $j++) {
						if (isset($category[$j]))
						echo '<option value="'.$category[$j]["caid"].'" '; 
						if ($news[0]["cat"]==$category[$j]["caid"]) echo 'selected="selected"'; 
						echo '>'.$category[$j]["title"].'</option>';
						} ?>
					</select>
				</div> 
			</div> 
			<div class="divclear ptop">
				<div class="flleft alright w200p"><label for="title">Название: </label></div>
				<div class="flleft alleft w525p"><input id="title" name="title" type="text" maxlength="255" value = "<?php echo $news[0]["title"]; ?>" /> 
				<label for="trno">Номер: </label>
				<label for="trno"><input id="trno" name="trno" type="text" maxlength="50" value = "<?php echo $news[0]["trno"]; ?>" style="width:30px;"/></label></div>
			</div> 
			<div class="divclear ptop">
				<div class="flleft alright w200p"><label for="url">Название для ЧПУ: </label></div>
				<div class="flleft alleft w525p"><input id="url" name="url" type="text" maxlength="255" value = "<?php echo $news[0]["url"]; ?>"/></div> 
			</div>
			<div class="divclear ptop">
				<div class="flleft alright w200p"><label for="artist">Исполнитель: </label></div>
					<div class="flleft alleft w525p">
						<select id="artist" name="artist" style="width:140px;"> 
							<?php for ($j = 0; $j < count($artist); $j++) {						 
						echo '<option value="'.$artist[$j]["name"].'" ';
						if ($news[0]["artist"]==$artist[$j]["name"]) echo 'selected="selected"'; 
						echo '>'.$artist[$j]["name"].'</option>';
						} ?>
						</select>
					</div>
			</div> 
			<div class="divclear ptop">
				<div class="flleft alright w200p"><label for="alid">Альбом: </label></div>
				<div class="flleft alleft w525p">
					<select id="alid" name="alid" style="width:140px;"> 
						<?php for ($j = 0; $j < count($albums); $j++) {						 
						echo '<option value="'.$albums[$j]["alid"].'/'.$albums[$j]["title"].'" >'.$albums[$j]["title"].'</option>';
						} ?>
					</select>
				</div>
			</div> 
			<div class="divclear ptop">
				<div class="flleft alright w200p"><label for="genre">Жанр: </label></div>
				<div class="flleft alleft w525p"><input id="genre" name="genre" type="text" maxlength="255" value = "<?php echo $news[0]["genre"]; ?>"/></div> 
			</div>
			<div class="divclear ptop">
				<div class="flleft alright w200p"><label for="year">Год: </label></div>
				<div class="flleft alleft w525p"><input id="year" name="year" type="text" maxlength="255" value = "<?php echo $news[0]["year"]; ?>"/></div>
			</div>
			<div class="divclear ptop">
				<div class="flleft alright w200p"><label for="length">Продолжительность: </label></div>
				<div class="flleft alleft w525p"><input id="length" name="length" type="text" maxlength="255" value = "<?php echo $news[0]["length"]; ?>"/></div> 
			</div>
			<div class="divclear ptop">
				<div class="flleft alright w200p"><label for="image">Картинка трека: </label></div>
				<div class="flleft alleft w525p"><input id="image" name="image" type="text" maxlength="255" value = "<?php echo $news[0]["image"]; ?>"/></div> 
			</div>
			<div class="divclear ptop">
				<div class="flleft alright w200p"><label for="file">Файл трека: </label></div>
				<div class="flleft alleft w525p"><input id="file" name="file" type="text" maxlength="255" value = "<?php echo $news[0]["file"]; ?>"/></div> 
			</div>
			<div class="divclear ptop">
				<div class="flleft alright w200p"><label for="keywords">Ключевые слова: </label></div>
				<div class="flleft alleft w525p"><input id="keywords" name="keywords" type="text" maxlength="255" style="width:500px;" value = "<?php echo $news[0]["keywords"]; ?>"/></div>
			</div> 
			<div class="divclear ptop">
				<div class="flleft alright w200p"><label for="description">Описание: </label></div>
				<div class="flleft alleft w525p"><textarea id="description" name="description" rows="" cols="" style="width:500px;"><?php echo $news[0]["description"]; ?></textarea></div>
			</div>
			<div class="divclear ptop">
				<div class="flleft alright w200p"><label for="onmain">Выводить на главной:</label></div>
				<div class="flleft alleft w525p">
					<input id="onmain" name="onmain" type="checkbox" value="1" <?php if ($news[0]["onmain"]==1) echo 'checked="checked"'; ?>/>
				</div>
			</div>
			<div class="divclear ptop">
				<div class="flleft alright w200p"><label for="update">Обновить дату:</label></div>
				<div class="flleft alleft w525p">
					<input id="date" name="date" type="hidden" value="<?php echo $news[0]["date"]; ?>" />
					<input id="update" name="update" type="checkbox" value="1" />
				</div>
			</div>
			<div class="divclear ptop">
				<div class="flleft alright w200p"><label for="cnt">Сбросить счетчик:</label></div>
				<div class="flleft alleft w525p">
					<input id="views" name="views" type="hidden" value="<?php echo $news[0]["views"]; ?>" />
					<input id="cnt" name="cnt" type="checkbox" value="1" />
				</div>
			</div>
			<div class="divclear ptop">
				<input type = 'submit' name = 'send' value = 'отправить' />
			</div>
		</form>
	</div>			
	</div>
	<div class="content_footer"></div>
</div>
<br />